﻿using System;
using System.Security.Cryptography;
using System.Text;

namespace Bussiness
{
    public class Security
    {
        private static MD5CryptoServiceProvider md5 = null;

        public static string EncryptMD5(string password)
        {
            md5 = new MD5CryptoServiceProvider();
            byte[] hasherBytes;
            UTF8Encoding encoder = new UTF8Encoding();
            hasherBytes = md5.ComputeHash(encoder.GetBytes(password));
            String passhash = Convert.ToBase64String(hasherBytes);
            return passhash;
        }
    }
}
